import { ref } from 'vue';
import { getPurchaseDetailsApi } from '@/api/sj/purchaseManagement/toBeStored/index'

const useAcceptanceReport = () => {

    const reportVisible = ref(false);
    const reportObj = ref({});
    const reportRow = ref({});

    /**
     * @description: 查看验收报告详情
     */
    const handleOpenReport = async (row: any) => {
        console.log(row);
        try {
            const { data } = await getPurchaseDetailsApi(row.id);
            reportObj.value = data;
            reportRow.value = row;
            reportVisible.value = true;
        } catch (error) {

        }
    };


    return {
        reportVisible,
        reportObj,
        reportRow,
        handleOpenReport,
    }
};

export default useAcceptanceReport;